var width=screen.availWidth;//获取浏览器可用的宽度
var height=screen.availHeight;
var getContent=document.getElementsByClassName('content');
var getAnchor=document.getElementsByClassName('anchor');
function arrivals(theAnchor) {
    location.href=theAnchor;
}
onload=function () {
    for(var i=0;i<getContent.length;i++){    //设置大的div高度和宽度
        getContent[i].style.height=height+'px';
        getContent[i].style.width=width+'px';
    }
    var setHeight=height*0.05+'px';//设置统一高度
    var getSmall=document.getElementsByClassName('small');
    for(var i=0;i<getSmall.length;i++){
        getSmall[i].style.height=setHeight;
    }
    document.getElementById('nav').style.height=setHeight;

}

//监听事件
for(var i=0;i<getAnchor.length;i++ ){
    getAnchor[i].num=i;
    getAnchor[i].addEventListener('click',function () {
        var theAnchor='#div'+this.num;
        arrivals(theAnchor);
    },false)
}
